package zyn_hy_login;

public class Z8_tree
{
	private DB_conn conn;
	private String connId;
	private int id;
	private int id2;
	private int id3;
	private String img;
	private String info;
	private String name;
	private String num;
	private String sign;
	private String tableName;
	private int type_id;
	private String url;
	private String x50;
	private String x51;
	private String x52;
	private String x53;
	private String x54;
	private String x55;
	private String x56;
	private String x57;
	private String x58;
	private String x59;
	private String x60;
	private String x61;
	private String x62;
	private String x63;
	private String x64;
	private String zt;

	public Z8_tree()
	{
	}

	public Z8_tree(String strconnId)
	{
		this.connId = strconnId;
		this.conn = new DB_conn(strconnId);
		this.tableName = this.conn.getDbTable();
	}

	public Z8_tree(String strId, String strconnId)
	{
		this.connId = strconnId;
		this.conn = new DB_conn(strconnId);
		this.tableName = this.conn.getDbTable();
		String strSql = " select * from " + this.tableName + " where type_id<>1 and id = " + strId;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");
		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.num = row.getItem("num").toString().trim();
		this.info = row.getItem("info").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.img = row.getItem("img").toString().trim();
		this.url = row.getItem("url").toString().trim();
		this.sign = row.getItem("sign").toString().trim();
		this.type_id = (Integer) row.getItem("type_id");
		this.x50 = row.getItem("x50").toString().trim();
		this.x51 = row.getItem("x51").toString().trim();
		this.x52 = row.getItem("x52").toString().trim();
		this.x53 = row.getItem("x53").toString().trim();
		this.x54 = row.getItem("x54").toString().trim();
		this.x55 = row.getItem("x55").toString().trim();
		this.x56 = row.getItem("x56").toString().trim();
		this.x57 = row.getItem("x57").toString().trim();
		this.x58 = row.getItem("x58").toString().trim();
		this.x59 = row.getItem("x59").toString().trim();
		this.x60 = row.getItem("x60").toString().trim();
		this.x61 = row.getItem("x61").toString().trim();
		this.x62 = row.getItem("x62").toString().trim();
		this.x63 = row.getItem("x63").toString().trim();
		this.x64 = row.getItem("x64").toString().trim();
	}

	public Z8_tree(String strId, String strId2, String strconnId)
	{
		this.connId = strconnId;
		this.conn = new DB_conn(strconnId);
		this.tableName = this.conn.getDbTable();
		String strSql = " select * from " + this.tableName + " where id = " + strId + " and id2=" + strId2;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");
		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.num = row.getItem("num").toString().trim();
		this.info = row.getItem("info").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.img = row.getItem("img").toString().trim();
		this.url = row.getItem("url").toString().trim();
		this.sign = row.getItem("sign").toString().trim();
		this.type_id = (Integer) row.getItem("type_id");
		this.x50 = row.getItem("x50").toString().trim();
		this.x51 = row.getItem("x51").toString().trim();
		this.x52 = row.getItem("x52").toString().trim();
		this.x53 = row.getItem("x53").toString().trim();
		this.x54 = row.getItem("x54").toString().trim();
		this.x55 = row.getItem("x55").toString().trim();
		this.x56 = row.getItem("x56").toString().trim();
		this.x57 = row.getItem("x57").toString().trim();
		this.x58 = row.getItem("x58").toString().trim();
		this.x59 = row.getItem("x59").toString().trim();
		this.x60 = row.getItem("x60").toString().trim();
		this.x61 = row.getItem("x61").toString().trim();
		this.x62 = row.getItem("x62").toString().trim();
		this.x63 = row.getItem("x63").toString().trim();
		this.x64 = row.getItem("x64").toString().trim();
	}

	public final int DelData(String strid)
	{
		String strSql = ("delete " + this.conn.getDbTable() + " where id = ") + " '" + strid + "'";
		try
		{
			this.conn.excuteSql(strSql);
		}
		catch (java.lang.Exception e)
		{
			return 0;
		}
		return 1;
	}

	public final int getChildCount(String strId, String strId3, String usId3)
	{
		int num = 0;
		if (this.sign.equals("folder"))
		{
			String strSql = " select id from " + this.conn.getDbTable() + " where id2 = " + strId + " and zt<>'0' ";
			num = this.conn.excuteSqlCount(strSql);
			if (!strId3.equals(usId3))
			{
				DB_conn _conn = new DB_conn(strId3);
				String text2 = " select id from " + _conn.getDbTable() + " where id2 = " + strId + " and zt<>'0' ";
				num += _conn.excuteSqlCount(text2);
			}
		}
		return num;
	}

	public final String getMaxId(String strsign)
	{
		int num;
		String strSql = "";
		switch (strsign)
		{
			case "u":
				strSql = " select max(id) as mid from " + this.conn.getDbTable() + " where id<59999 and id>=20000 ";
				break;

			case "r":
				strSql = " select max(id) as mid from " + this.conn.getDbTable() + " where id<69999 and id>=60000 ";
				break;

			case "p":
				strSql = " select max(id) as mid from " + this.conn.getDbTable() + " where id<99999 and id>=80000 ";
				break;

			case "f":
				strSql = " select max(id) as mid from " + this.conn.getDbTable() + " where id<199999 and id>=100000 ";
				break;

			default:
				strSql = " select max(id) as mid from " + this.conn.getDbTable() + " where  id>=200000 ";
				break;
		}
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		String s = "";
		if (!row.IsNull(0))
		{
			s = row.getItem("mid").toString().trim();
		}
		else
		{
			switch (strsign)
			{
				case "u":
					s = "19999";
//C# TO JAVA CONVERTER TODO TASK: There is no 'goto' in Java:
					goto Label_01A4;

				case "r":
					s = "59999";
//C# TO JAVA CONVERTER TODO TASK: There is no 'goto' in Java:
					goto Label_01A4;

				case "p":
					s = "79999";
//C# TO JAVA CONVERTER TODO TASK: There is no 'goto' in Java:
					goto Label_01A4;

				case "f":
					s = "99999";
//C# TO JAVA CONVERTER TODO TASK: There is no 'goto' in Java:
					goto Label_01A4;
			}
			s = "199999";
		}
	Label_01A4:
		num = Integer.parseInt(s) + 1;
		return String.valueOf(num);
	}

	public final String getName(String strId)
	{
		String strSql = " select name from " + this.conn.getDbTable() + " where id = " + strId;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		return row.getItem("name").toString().trim();
	}

	public final int getNameCount(String pid, String cname, String zt)
	{
		String strSql = " select id from " + this.conn.getDbTable() + " where name='" + cname + "'and zt='" + zt + "' and id2=" + pid;
		return this.conn.excuteSqlCount(strSql);
	}

	public final String getNewId(String strpid)
	{
		int num = Integer.parseInt(strpid);
		if ((0x4e20 <= num) && (num < 0xea5f))
		{
			return this.getMaxId("u");
		}
		if ((0xea60 <= num) && (num < 0x1116f))
		{
			return this.getMaxId("r");
		}
		if ((0x13880 <= num) && (num < 0x1869f))
		{
			return this.getMaxId("p");
		}
		if ((0x186a0 <= num) && (num < 0x30d3f))
		{
			return this.getMaxId("f");
		}
		return this.getMaxId("5");
	}

	public final String getParentId(String strId)
	{
		String strSql = " select id2 from " + this.conn.getDbTable() + " where id = " + strId;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		return row.getItem("id2").toString().trim();
	}

	public final String getProUrl()
	{
		DataRow row = DBCommon.getDataBySqluniquetempvar.Tables[0].Rows[0];
		return row.getItem("url").toString().trim();
	}

	public final String getSign(String strId)
	{
		String strSql = " select sign from " + this.conn.getDbTable() + " where id = " + strId;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		return row.getItem("sign").toString().trim();
	}

	public final int InsertData()
	{
		String strSql = (((((((((((((((((((((((((("insert into " + this.conn.getDbTable() + "(id,id2,id3,name,num,info,zt,img,url,sign,type_id,x50,x51,x52,x53,x54,x55,x56,x57,x58,x59,x60,x61,x62,x63,x64) values( ") + " " + String.valueOf(this.id) + ",") + " " + String.valueOf(this.id2) + ",") + " " + String.valueOf(this.id3) + ",") + " '" + this.name + "',") + " '" + this.num + "',") + " '" + this.info + "',") + " '" + this.zt + "',") + " '" + this.img + "',") + " '" + this.url + "',") + " '" + this.sign + "',") + " " + String.valueOf(this.type_id) + ",") + " '" + this.x50 + "',") + " '" + this.x51 + "',") + " '" + this.x52 + "',") + " '" + this.x53 + "',") + " '" + this.x54 + "',") + " '" + this.x55 + "',") + " '" + this.x56 + "',") + " '" + this.x57 + "',") + " '" + this.x58 + "',") + " '" + this.x59 + "',") + " '" + this.x60 + "',") + " '" + this.x61 + "',") + " '" + this.x62 + "',") + " '" + this.x63 + "',") + " '" + this.x64 + "' )";
		try
		{
			this.conn.excuteSql(strSql);
		}
		catch (java.lang.Exception e)
		{
			return 0;
		}
		return 1;
	}

	public final void Set_date(String strId)
	{
		String strSql = " select * from " + this.conn.getDbTable() + " where id = " + strId;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");
		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.num = row.getItem("num").toString().trim();
		this.info = row.getItem("info").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.img = row.getItem("img").toString().trim();
		this.url = row.getItem("url").toString().trim();
		this.sign = row.getItem("sign").toString().trim();
		this.type_id = (Integer) row.getItem("type_id");
		this.x50 = row.getItem("x50").toString().trim();
		this.x51 = row.getItem("x51").toString().trim();
		this.x52 = row.getItem("x52").toString().trim();
		this.x53 = row.getItem("x53").toString().trim();
		this.x54 = row.getItem("x54").toString().trim();
		this.x55 = row.getItem("x55").toString().trim();
		this.x56 = row.getItem("x56").toString().trim();
		this.x57 = row.getItem("x57").toString().trim();
		this.x58 = row.getItem("x58").toString().trim();
		this.x59 = row.getItem("x59").toString().trim();
		this.x60 = row.getItem("x60").toString().trim();
		this.x61 = row.getItem("x61").toString().trim();
		this.x62 = row.getItem("x62").toString().trim();
		this.x63 = row.getItem("x63").toString().trim();
		this.x64 = row.getItem("x64").toString().trim();
	}

	public final void Set_date(String strId, String strId2)
	{
		String strSql = " select * from " + this.conn.getDbTable() + " where id = " + strId + " and id2=" + strId2;
		DataRow row = this.conn.getDataBySql(strSql).Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");
		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.num = row.getItem("num").toString().trim();
		this.info = row.getItem("info").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.img = row.getItem("img").toString().trim();
		this.url = row.getItem("url").toString().trim();
		this.sign = row.getItem("sign").toString().trim();
		this.type_id = (Integer) row.getItem("type_id");
		this.x50 = row.getItem("x50").toString().trim();
		this.x51 = row.getItem("x51").toString().trim();
		this.x52 = row.getItem("x52").toString().trim();
		this.x53 = row.getItem("x53").toString().trim();
		this.x54 = row.getItem("x54").toString().trim();
		this.x55 = row.getItem("x55").toString().trim();
		this.x56 = row.getItem("x56").toString().trim();
		this.x57 = row.getItem("x57").toString().trim();
		this.x58 = row.getItem("x58").toString().trim();
		this.x59 = row.getItem("x59").toString().trim();
		this.x60 = row.getItem("x60").toString().trim();
		this.x61 = row.getItem("x61").toString().trim();
		this.x62 = row.getItem("x62").toString().trim();
		this.x63 = row.getItem("x63").toString().trim();
		this.x64 = row.getItem("x64").toString().trim();
	}

	public final int UpdateData()
	{
		Object obj2 = (((((((((((((((((((((((((" update " + this.conn.getDbTable() + " set ") + "id2 = " + String.valueOf(this.id2) + ",") + "id3 = " + String.valueOf(this.id3) + ",") + "name = '" + this.name + "',") + "num = '" + this.num + "',") + "info = '" + this.info + "',") + "zt = '" + this.zt + "',") + "img = '" + this.img + "',") + "url = '" + this.url + "',") + "sign = '" + this.sign + "',") + "type_id= " + String.valueOf(this.type_id) + ",") + "x50= '" + this.x50 + "',") + "x51= '" + this.x51 + "',") + "x52= '" + this.x52 + "',") + "x53= '" + this.x53 + "',") + "x54= '" + this.x54 + "',") + "x55= '" + this.x55 + "',") + "x56= '" + this.x56 + "',") + "x57= '" + this.x57 + "',") + "x58= '" + this.x58 + "',") + "x59= '" + this.x59 + "',") + "x60= '" + this.x60 + "',") + "x61= '" + this.x61 + "',") + "x62= '" + this.x62 + "',") + "x63= '" + this.x63 + "',") + "x64= '" + this.x64 + "' ";
		String strSql = String.Concat(new Object[] {obj2, "where id = ", this.id, ""});
		try
		{
			this.conn.excuteSql(strSql);
		}
		catch (java.lang.Exception e)
		{
			return 0;
		}
		return 1;
	}

	public final int UpdateDatax52()
	{
		Object obj2 = (" update " + this.conn.getDbTable() + " set ") + "x52= '" + this.x52 + "'";
		String strSql = String.Concat(new Object[] {obj2, "where id = ", this.id, ""});
		try
		{
			this.conn.excuteSql(strSql);
		}
		catch (java.lang.Exception e)
		{
			return 0;
		}
		return 1;
	}

	public final DB_conn getConn()
	{
		return this.conn;
	}
	public final void setConn(DB_conn value)
	{
		this.conn = value;
	}

	public final String getConnId()
	{
		return this.connId;
	}
	public final void setConnId(String value)
	{
		this.connId = value;
	}

	public final int getId()
	{
		return this.id;
	}
	public final void setId(int value)
	{
		this.id = value;
	}

	public final int getId2()
	{
		return this.id2;
	}
	public final void setId2(int value)
	{
		this.id2 = value;
	}

	public final int getId3()
	{
		return this.id3;
	}
	public final void setId3(int value)
	{
		this.id3 = value;
	}

	public final String getImg()
	{
		return this.img;
	}
	public final void setImg(String value)
	{
		this.img = value;
	}

	public final String getInfo()
	{
		return this.info;
	}
	public final void setInfo(String value)
	{
		this.info = value;
	}

	public final String getName()
	{
		return this.name;
	}
	public final void setName(String value)
	{
		this.name = value;
	}

	public final String getNum()
	{
		return this.num;
	}
	public final void setNum(String value)
	{
		this.num = value;
	}

	public final String getSign()
	{
		return this.sign;
	}
	public final void setSign(String value)
	{
		this.sign = value;
	}

	public final String getTableName()
	{
		return this.tableName;
	}
	public final void setTableName(String value)
	{
		this.tableName = value;
	}

	public final int getType_id()
	{
		return this.type_id;
	}
	public final void setType_id(int value)
	{
		this.type_id = value;
	}

	public final String getUrl()
	{
		return this.url;
	}
	public final void setUrl(String value)
	{
		this.url = value;
	}

	public final String getX50()
	{
		return this.x50;
	}
	public final void setX50(String value)
	{
		this.x50 = value;
	}

	public final String getX51()
	{
		return this.x51;
	}
	public final void setX51(String value)
	{
		this.x51 = value;
	}

	public final String getX52()
	{
		return this.x52;
	}
	public final void setX52(String value)
	{
		this.x52 = value;
	}

	public final String getX53()
	{
		return this.x53;
	}
	public final void setX53(String value)
	{
		this.x53 = value;
	}

	public final String getX54()
	{
		return this.x54;
	}
	public final void setX54(String value)
	{
		this.x54 = value;
	}

	public final String getX55()
	{
		return this.x55;
	}
	public final void setX55(String value)
	{
		this.x55 = value;
	}

	public final String getX56()
	{
		return this.x56;
	}
	public final void setX56(String value)
	{
		this.x56 = value;
	}

	public final String getX57()
	{
		return this.x57;
	}
	public final void setX57(String value)
	{
		this.x57 = value;
	}

	public final String getX58()
	{
		return this.x58;
	}
	public final void setX58(String value)
	{
		this.x58 = value;
	}

	public final String getX59()
	{
		return this.x59;
	}
	public final void setX59(String value)
	{
		this.x59 = value;
	}

	public final String getX60()
	{
		return this.x60;
	}
	public final void setX60(String value)
	{
		this.x60 = value;
	}

	public final String getX61()
	{
		return this.x61;
	}
	public final void setX61(String value)
	{
		this.x61 = value;
	}

	public final String getX62()
	{
		return this.x62;
	}
	public final void setX62(String value)
	{
		this.x62 = value;
	}

	public final String getX63()
	{
		return this.x63;
	}
	public final void setX63(String value)
	{
		this.x63 = value;
	}

	public final String getX64()
	{
		return this.x64;
	}
	public final void setX64(String value)
	{
		this.x64 = value;
	}

	public final String getZt()
	{
		return this.zt;
	}
	public final void setZt(String value)
	{
		this.zt = value;
	}
}